TARGET=incheck
TESTFILE=../testfile

echo -e "\nMaking inch ..."

make -f ../Makefile clean > /dev/null
sleep 2
make -f ../Makefile > /dev/null
sleep 3

if [ $? ]
then
    echo -e "Make:\033[32m success\033[0m"
else
    echo -e "Make:\033[31m failed\033[0m"
    echo $?
    exit 1
fi

echo "Executing inch ..."

../$TARGET $TESTFILE > /dev/null

if [ $? ]
then
    echo -e "Execution:\033[32m success\033[0m"
else
    echo -e "Execution:\033[31m failed\033[0m"
    exit 1
fi

echo "Valgrinding inch ..."

valgrind -q ../$TARGET $TESTFILE > /dev/null

if [ $? ]
then
    echo -e "Valgrind:\033[32m success\033[0m"
else
    echo -e "Valgrind:\033[32m success\033[0m"
fi

echo -e ""
